package com.haiberg.framework.om;

import java.sql.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name="record", catalog="public")
public class Record implements java.io.Serializable  {
	private Integer id;
	private String title;
	private String content;
	private Date date;
	
	public Record(){}
	public Record(String title, String content, Date date) {
		super();
		this.title = title;
		this.content = content;
		this.date = date;
	}
	public Record(Integer id, String title, String content, Date date) {
		super();
		this.id = id;
		this.title = title;
		this.content = content;
		this.date = date;
	}
	//@Id
	//@SequenceGenerator(name="record_id_seq",sequenceName="record_id_seq")
	//@GeneratedValue(strategy=GenerationType.SEQUENCE)   
	//@Column(name = "id", unique = true, nullable = false)
	
	@Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "func")
    @SequenceGenerator(name = "func", allocationSize=1, initialValue=1, sequenceName = "record_id_seq")
    @Column(name = "ID")
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	@Column(name="title")
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	@Column(name="content")
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	@Column(name="date")
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	
}
